﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <script src="Base/js/jquery-1.8.1.js"></script>
</head>
<body>
    <input id="Text1" type="text" /><input id="Button1" type="button" value="给radio赋值" />
    <input id="Radio1" type="radio" value="1" name="hehe"/>
    <table id="1">
        <tr>
            <td>ds</td>
            <td>dsfds</td>
        </tr>
    </table>
    <table id="2">
        <tr>
            <td>dsadsa</td>
            <td>555555555</td>
        </tr>
    </table>
    <script>
        $(document).ready(function () {
            $("#Button1").click(function () {
                $("#Radio1").val($("#Text1").val());
                $("input[name='hehe']").removeAttr("checked");
            });

            $("input[name='hehe']").change(function () {
                if ($(this).val() == "1") {
                    $("#1").hide();
                    $("#2").show();
                }
                else {
                    $("#1").show();
                    $("#2").hide();
                }
            });
            
        })
    </script>
</body>
</html>
